//
//  ULViewController.m
//  ULYYText
//
//  Created by xiangfei.liu on 11/22/2019.
//  Copyright (c) 2019 xiangfei.liu. All rights reserved.
//

#import "ULViewController.h"
#import <YYText.h>

@interface ULViewController ()

@end

@implementation ULViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    UIView *view = [[UIView alloc] initWithFrame:self.view.bounds];
       [self.view addSubview:view];
       view.backgroundColor = [UIColor greenColor];
       YYTextView *textView = [[YYTextView alloc] initWithFrame:CGRectMake(50, 200, 280, 80)];
       textView.backgroundColor = [UIColor redColor];
       textView.font = [UIFont systemFontOfSize:20 weight:UIFontWeightBold];
       textView.textColor = [UIColor blueColor];
       [view addSubview:textView];
       UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
       [view addGestureRecognizer:tap];

       NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString: @"fhwaefiowjefojasoefjeisjfaewjfoasjfosejfiosjfioew"];
       string.yy_font = [UIFont systemFontOfSize:17];
       string.yy_color = [UIColor blackColor];
       string.yy_lineSpacing = 7;
       textView.attributedText = string;
}

- (void)tapAction:(UITapGestureRecognizer *)sender {
    [self.view endEditing:YES];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
